class Restaurant < ActiveRecord::Base
  has_many :dishes
  has_many :orders
  validates_presence_of :name, :telephone
  validates_uniqueness_of :name
  
  def register (dish)
    dish.restaurant = self
    self.dishes << dish
  end
end
